package com.bw.module_main

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.bw.module_main.GuideActivity.GuideItem

class GuidePagerAdapter(private val context: Context, private val guideItems: List<GuideItem>) :
    RecyclerView.Adapter<GuidePagerAdapter.GuideViewHolder>() {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GuideViewHolder {
        val view = LayoutInflater.from(context).inflate(guideItems[viewType].layoutResId, parent, false)
        return GuideViewHolder(view)
    }

    override fun onBindViewHolder(holder: GuideViewHolder, position: Int) {
        // 引导页内容已在布局文件中定义，这里可以根据需要进行额外的数据绑定
    }

    override fun getItemCount(): Int = guideItems.size

    override fun getItemViewType(position: Int): Int = position

    class GuideViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
}